package com.xbh.management.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: management-center
 * @description: 映射本地服务器图片地址
 * @author: 许宝华
 * @create: 2021-09-22 18:24
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    /**
     * 将前端请求地址映射到服务器实际目录
     * @param registry
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/user/upload/**").addResourceLocations("file:" + "D:\\management-center\\management-center-provider\\src\\main\\resources\\upload\\");
    }
}
